package com.yuhang.dao;

import com.yuhang.domain.Actor;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface ActorDao {


         @Insert("insert into actor(first_name,last_name) values(#{first_name},#{last_name})")
             void save(Actor actor);

         @Delete("delete from actor where actor_id = #{actor_id} ")
 void delete(Integer id);

         @Update("update actor set first_name = #{first_name} , last_name = #{last_name} where actor_id = #{actor_id} ")
             void update(Actor account);

         @Select("select * from actor")List<Actor> findAll();

         @Select("select * from actor where actor_id = #{actor_id} ")Actor findById(Integer id);
 }